package com.telnikoff.gf;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class DefaultGfMenu implements GfMenu
{
	private final List<GfMenuBranch> branches;
	
	protected DefaultGfMenu()
	{
		branches = new ArrayList<GfMenuBranch>();
	}

	@Override
	public void add(GfMenuBranch branch) 
	{
		branches.add(branch);
	}

	@Override
	public boolean isEmpty() 
	{
		return branches.size() == 0;
	}

	@Override
	public String getName() 
	{
		return null;
	}

	@Override
	public Collection<GfMenuBranch> getBranches() 
	{
		return branches;
	}

	@Override
	public GfMenuFactory getFactory() 
	{
		return new DefaultGfMenuFactory(this);
	}

}